<template>
	<view>
		<view class="active flex-space-between" v-if="seckillProduct.length > 0 || assembleProduct.length > 0">
			<view class="active-item bg-fff" @click="jump('/pages/active/seckill/seckill')"
				v-if="seckillProduct.length > 0">
				<view class="active-item-top">
					<view class="active-item-title">秒杀专区</view>
					<view class="active-item-line">秒杀专区</view>
				</view>
				
		
				<view class="active-item-product flex-align-center">
					<view class="flex-column-center active-item-seckill" v-for="(item,index) in seckillProduct" :key="index"
						v-if="index < 2">
						<image class="active-item-product-image" :src="item.product.file_path"></image>
						<view class="active-item-product-price flex-center"
							:style="{background: 'url('+$setting.imageUrl()+'seckill_price_bg.png) no-repeat', backgroundSize: '136rpx 48rpx'}">
							￥{{item.seckill_price}}</view>
					</view>
					<view v-if="seckillProduct.length == 1"></view>
				</view>
			</view>
			<view class="active-item bg-fff" @click="jump('/pages/active/assemble/assemble')"
				v-if="assembleProduct.length > 0">
				<view class="active-item-title">拼团专区</view>
				<view class="active-item-product flex-align-center">
					<view class="flex-column-center active-item-assemb" v-for="(item,index) in assembleProduct" :key="index"
						v-if="index < 2">
						<image class="active-item-product-image" :src="item.product.file_path"></image>
						<view class="active-item-product-name u-line-1">{{item.product.product_name}}</view>
					</view>
					<view v-if="assembleProduct.length == 1"></view>
				</view>
			</view>
		</view>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {}
		},
		props: ["seckillProduct", "assembleProduct"],
		methods:{
			jump(url) {
				uni.navigateTo({
					url: url
				})
			},
		}
	}
</script>

<style lang="scss">
	@font-face {
		font-family: "YouSheBiao";
		src:url('https://jiumiaoda.oss-cn-guangzhou.aliyuncs.com/wechat/font/YouSheBiaoTiHei-2.ttf')
	}
	.active {
		margin-top: 20rpx;

		.active-item {
			border-radius: 16rpx;
			width: 332rpx;
			height: 254rpx;

			.active-item-title {
				padding: 12rpx 22rpx 22rpx;
				font-size: 28rpx;
				color: #111111;
				font-weight: bold;
			}
			
			.active-item-line{
				font-family: 'YouSheBiao';
				font-size: 14px;
			}

			.active-item-product {
				padding: 0 0 22rpx 0;

				.active-item-seckill {
					// flex: 1;
					width: 49%;
				}

				.active-item-product-image {
					width: 108rpx;
					height: 108rpx;
				}

				.active-item-product-price {
					margin-top: 20rpx;
					font-size: 24rpx;
					color: #ffffff;
					width: 136rpx;
					height: 48rpx;
					padding-left: 25rpx;
				}

				.active-item-assemb {
					// flex: 1;
					width: 49%;
				}

				.active-item-product-name {
					font-size: 24rpx;
					color: #9E9E9E;
					margin-top: 20rpx;
					width: 120rpx;
				}
			}
		}
	}
</style>